<?php
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use yii\widgets\LinkPager;
use frontend\controllers\ListController;
use common\models\articles\Articles;

    $zhengce = Articles::find()->where(['category_id'=>25, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();
    $hangye = Articles::find()->where(['category_id'=>28, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();
    $xinwen = Articles::find()->where(['category_id'=>14, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();
?>
    <style>
        .divtoneul{
            height: auto;
        }
        .divtoneul li{
            margin-bottom: 8px;
        }
        .jydiv{
            height: auto;
        }
        .jydiv li{
            width: 100%;
        }
        .jydiv li:last-child{
            border-bottom: none;
        }
        .jydiv .newh3{
            margin-bottom: 8px;
        }
    </style>

    <div class="content">
        <div class="w1200 clearFloat mb50">
           <h3 class="abouth3">当前位置：<a href="<?= yii\helpers\Url::to(['/']);?>">首页</a> > <a href="<?= yii\helpers\Url::to([$parentinfo['type'], 'id' => $parentinfo['id']]); ?>"><?= $parenttitle; ?> > </a><a> <?= $title; ?></a></h3>
             <div class="clearFloat">
                <div class="jjleft floatLeft">
                    <div class="clearFloat">
                        <h3 class="jjtitle"><?= $parenttitle;?></h3>
                        <ul class="jjul">
                            <?php foreach($childcat as $t){ ?>
                            <li<?php if($id == $t['id']){echo ' class="jjactive"';} ?>>
                                <a href="<?= yii\helpers\Url::to([$t['type'], 'id' => $t['id']]); ?>">
                                    <?php echo $t['name']; ?>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
                <div class="jjmiddle floatLeft">
                    <div class="clearFloat">
                        <ul class="jydiv">
                            <?php foreach($articles as $t) {?>
                            <li>
                                <a href="<?= yii\helpers\Url::to([$ctype, 'id' => $t['id']]); ?>">
                                    <img src="/upload/<?= json_decode($t['label_img'], true)['newname'];?>" alt="" width="202" height="115" class="floatLeft mr15">
                                    <h3 class="newh3"><?=$t['title'];?></h3>
                                    <span class="jypxspan"><?= mb_substr(strip_tags($t['summary']),0,30,'utf-8'); ?><?php if(strlen($t['summary']) > 91) { echo '...'; } ?></span>
                                </a>
                                <?php if(strtotime($t['deadline']) > time()) { ?>
                                <a href="<?= yii\helpers\Url::to(['meetingenroll/create','id' => $t['id']]); ?>" class="bmsubhove">立即报名</a>
                                <?php } else { ?>
                                <a class="bmsub">已结束</a>
                                <?php } ?>
                            </li>
                            <?php } ?>
                        </ul>
                        <div class="newpage mt50 mb50">
                                <?php if($page)
                                {
                                    echo LinkPager::widget([
                                    'maxButtonCount' => 6,
                                    'prevPageLabel' =>'&lt;',
                                    'nextPageLabel' =>'&gt;',
                                    'pagination'=>$page,
                                    ]);
                                }
                                ?>
                        </div>
                    </div>
                </div>
                <div class="jjright floatRight">
                    <div class="clearFloat ppjs">
                        <h3 class="indexh3"><span>协会新闻</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($xinwen as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                            <?php } ?>
                      </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>行业研究</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($hangye as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>政策法规</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($zhengce as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                </div>

            </div>
        </div>
    </div>